package org.jypj.dev.controller;

import org.jypj.dev.model.CodeData;
import org.jypj.dev.model.Thing;
import org.jypj.dev.model.User;
import org.jypj.dev.service.ICodeDataService;
import org.jypj.dev.service.IThingService;
import org.jypj.dev.service.IThingUseRecordService;
import org.jypj.dev.util.*;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by ChenYu on 2017-03-06.
 * 物料管理控制器
 */
@Controller
@RequestMapping("thingUseController")
public class ThingUseController {



    @Resource
    private IThingUseRecordService thingUseRecordService;
    /**
     * 跳转到物品列表页
     * 查询所有部门
     *
     * @return
     */
    @RequestMapping(value = "toThingUseList.action")
    public String toThingList() {
        return "back/thing/thing_use_list";
    }

    /**
     * 分页查询车次
     *
     * @param page
     * @return
     */
    @RequestMapping("selectOnePage.action")
    @ResponseBody
    public Page selectOnePage(Page page, String searchKey,String recordType,String recordDate) {
        Map<String, Object> map = new HashMap<>();
        map.put("searchKey", searchKey);
        map.put("recordDate", recordDate);
        map.put("recordType", recordType);
        page = thingUseRecordService.selectOnePageByMap(page, map);
        return page;
    }

}
